

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="Some usage for fvSchemes.">
  <meta name="author" content="Veen">
  <meta name="keywords" content="">
  <meta name="description" content="Some usage for fvSchemes.">
<meta property="og:type" content="article">
<meta property="og:title" content="fvSchemes">
<meta property="og:url" content="https://veenxz.github.io/OpenFOAM/fvSchemes/index.html">
<meta property="og:site_name" content="Veen">
<meta property="og:description" content="Some usage for fvSchemes.">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-01-19T01:51:25.000Z">
<meta property="article:modified_time" content="2021-10-14T17:30:19.017Z">
<meta property="article:author" content="Veen">
<meta property="article:tag" content="OpenFOAM">
<meta name="twitter:card" content="summary_large_image">
  
  <title>fvSchemes - Veen</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      
        
          
        
        <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.min.css" />
      
      
        <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/plugins/line-numbers/prism-line-numbers.min.css" />
      
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"veenxz.github.io","root":"/","version":"1.8.12","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname"}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  <header style="height: 55vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Veen</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/cinque-terre.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="fvSchemes">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-01-19 09:51" pubdate>
        2021年1月19日 上午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      4.2k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      13 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">fvSchemes</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2021年10月15日 凌晨
                
              </p>
            
            <div class="markdown-body">
              <p>Some usage for fvSchemes.</p>
<span id="more"></span>
<h1 id="1-实例"><a href="#1-实例" class="headerlink" title="1. 实例"></a>1. 实例</h1><p>下面是<code>fvSchemes</code> 文件的一个典型例子，其内容（略去文件头部注释）：</p>
<div class="code-wrapper"><pre class="line-numbers language-c++" data-language="c++"><code class="language-c++">&#x2F;&#x2F;文件说明
FoamFile
&#123;
    version     2.0;                &#x2F;&#x2F;版本号
    format      ascii;              &#x2F;&#x2F;文本格式
    class       dictionary;         &#x2F;&#x2F;类型为字典文件
    location    &quot;system&quot;;           &#x2F;&#x2F;所在目录
    object      fvSchemes;          &#x2F;&#x2F;对象名
&#125;
&#x2F;&#x2F;时间一阶导项(非定常项)格式
ddtSchemes
&#123;
    default         Euler;
&#125;
&#x2F;&#x2F;梯度项格式
gradSchemes
&#123;
    default         Gauss linear;
    grad(T)         Gauss linear;
&#125;
&#x2F;&#x2F;散度项格式
divSchemes
&#123;
    default         none;
&#125;
&#x2F;&#x2F;拉普拉斯项格式
laplacianSchemes
&#123;
    default         none;
    laplacian(DT,T) Gauss linear corrected;
&#125;
&#x2F;&#x2F;插值格式
interpolationSchemes
&#123;
    default         linear;
&#125;
&#x2F;&#x2F;面法向梯度格式
snGradSchemes
&#123;
    default         corrected;
&#125;
&#x2F;&#x2F;需要用来计算通量的场
fluxRequired
&#123;
    default         no;
    T;
&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></div>
<h1 id="2-fvSchemes-文件简介"><a href="#2-fvSchemes-文件简介" class="headerlink" title="2. fvSchemes 文件简介"></a>2. fvSchemes 文件简介</h1><p><code>system</code>目录下的<code>fvSchemes</code>文件用来设置 <strong>离散格式</strong>， 凡是求解器里面出现的方程，都需要在这里面进行离散格式设置。<code>fvSchemes</code>中需要指定的信息主要分为<code>7</code>类：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">子字典关键字</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>interpolationSchemes</code></td>
<td style="text-align:center">插值格式</td>
</tr>
<tr>
<td style="text-align:center"><code>snGradSchemes</code></td>
<td style="text-align:center">面法向梯度格式</td>
</tr>
<tr>
<td style="text-align:center"><code>timeScheme</code></td>
<td style="text-align:center">时间导数项,格式</td>
</tr>
<tr>
<td style="text-align:center"><code>divSchemes</code></td>
<td style="text-align:center">散度项格式</td>
</tr>
<tr>
<td style="text-align:center"><code>gradSchemes</code></td>
<td style="text-align:center">梯度项格式</td>
</tr>
<tr>
<td style="text-align:center"><code>laplacianSchemes</code></td>
<td style="text-align:center">拉普拉斯项格式</td>
</tr>
<tr>
<td style="text-align:center"><code>fluxRequired</code></td>
<td style="text-align:center">需要计算通量的场</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h1 id="3-插值格式-interpolationSchemes"><a href="#3-插值格式-interpolationSchemes" class="headerlink" title="3. 插值格式 interpolationSchemes"></a>3. 插值格式 interpolationSchemes</h1><p>插值格式在子字典<code>interpolationSchemes</code>下设置，通常用来指定从相邻两个 <strong>体单元</strong> 计算公共 <strong>面单元</strong> 处变量值的计算方法。<code>OpenFOAM</code>中可用的插值格式可以分为四类：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">类别</th>
<th style="text-align:center">插值格式</th>
<th style="text-align:center">用途</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">一类</td>
<td style="text-align:center">中心格式</td>
<td style="text-align:center">应用于普通场插值</td>
</tr>
<tr>
<td style="text-align:center">二类</td>
<td style="text-align:center">迎风格式</td>
<td style="text-align:center">主要应用于对流项</td>
</tr>
<tr>
<td style="text-align:center">三类</td>
<td style="text-align:center">TVD家族</td>
<td style="text-align:center">主要应用于对流项</td>
</tr>
<tr>
<td style="text-align:center">四类</td>
<td style="text-align:center">NVD家族</td>
<td style="text-align:center">主要应用于对流项</td>
</tr>
</tbody>
</table>
</div>
<h2 id="3-1-中心格式"><a href="#3-1-中心格式" class="headerlink" title="3.1 中心格式"></a>3.1 中心格式</h2><p>中心格式包括：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">中心格式</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>linear</code></td>
<td style="text-align:center">线性插值(中心差分)格式</td>
</tr>
<tr>
<td style="text-align:center"><code>cubicCorrection</code></td>
<td style="text-align:center">立方正交格式</td>
</tr>
<tr>
<td style="text-align:center"><code>midPoint</code></td>
<td style="text-align:center">对称加权线性插值格式</td>
</tr>
</tbody>
</table>
</div>
<p>中心格式的指定方式为：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default linear;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<h2 id="3-2-应用于对流项的插值格式"><a href="#3-2-应用于对流项的插值格式" class="headerlink" title="3.2 应用于对流项的插值格式"></a>3.2 应用于对流项的插值格式</h2><p>迎风格式包括：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">迎风格式</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>upwind</code></td>
<td style="text-align:center">一阶迎风格式</td>
</tr>
<tr>
<td style="text-align:center"><code>linearUpwind</code></td>
<td style="text-align:center">线性迎风格式</td>
</tr>
<tr>
<td style="text-align:center"><code>skewLinear</code></td>
<td style="text-align:center">带畸变修正线性迎风格式</td>
</tr>
<tr>
<td style="text-align:center"><code>filteredLinear2</code></td>
<td style="text-align:center">高频波过滤线性迎风格式</td>
</tr>
</tbody>
</table>
</div>
<p>TVD家族包括：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">TVD家族</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>limitedLinear</code></td>
<td style="text-align:center">有界线性格式</td>
</tr>
<tr>
<td style="text-align:center"><code>vanLeer</code></td>
<td style="text-align:center">van Leer有界格式</td>
</tr>
<tr>
<td style="text-align:center"><code>MUSCL</code></td>
<td style="text-align:center">MUSCL有界格式</td>
</tr>
<tr>
<td style="text-align:center"><code>limitedCubic</code></td>
<td style="text-align:center">立方正交有界格式</td>
</tr>
</tbody>
</table>
</div>
<p>NVD家族包括：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">NVD家族</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>SFCD</code></td>
<td style="text-align:center">自过滤中心格式</td>
</tr>
<tr>
<td style="text-align:center"><code>Gamma</code></td>
<td style="text-align:center">Gamma差分格式</td>
</tr>
</tbody>
</table>
</div>
<p>针对对流项的插值格式需要在通量的基础上计算插值，因此这些格式的指定需要提供通量场的名称。在<code>OpenFOAM</code>标准求解器中，体积通量名称一般为<code>phi</code>，类型<code>surfaceScalarField</code>（面心标量场），因此针对对流项的插值格式指定方式（以<code>upwind</code>格式为例）为：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default upwind phi;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<p>一些基于TVD或NVD的格式需要系数，介于<code>0</code>和<code>1</code>之间，（建议值）对应标准TVD格式，能够达到最快的收敛速度，对应最高精度，例如：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default limitedLinear phi 1.0;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<h2 id="3-3-严格有界标量格式"><a href="#3-3-严格有界标量格式" class="headerlink" title="3.3 严格有界标量格式"></a>3.3 严格有界标量格式</h2><p>某些标量场是严格有界的（<strong>有界性</strong>），例如VOF模型中的流体体积分数场（也有文献将其定义为），其值严格介于<code>0</code>和<code>1</code>之间，因此，才会出现一些带有限制器的增强版格式（除<code>SFCD</code>格式外，所有的TVD家族和NVD家族都具有带限制器的增强版本）。用户如果想要指定有界场的上下限，需要在格式名称前加上前缀<code>limited</code>。例如，将<code>vanLeer</code>格式上下限设置为：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default limitedVanLeer -2.0 3.0;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<p>需要注意的是，<code>OpenFOAM</code>遵循<a target="_blank" rel="noopener" href="https://zh.wikipedia.org/wiki/駝峰式大小寫">小驼峰式命名法</a>，<code>limitedVanLeer</code>中的<code>V</code>是大写的，注意与<code>vanLeer</code>的区分。特别地，对类似于流体体积分数场，上下限严格为，可以添加后缀<code>01</code>，如：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default vanLeer01;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<p>以下格式具有带限制器的增强版本:<code>limitedLinear</code>，<code>vanLeer</code>，<code>Gamma</code>，<code>limitedCubic</code>，<code>MUSCL</code>和<code>SuperBee</code>。</p>
<h2 id="3-4-矢量场专用格式"><a href="#3-4-矢量场专用格式" class="headerlink" title="3.4 矢量场专用格式"></a>3.4 矢量场专用格式</h2><p>针对矢量场的 <strong>有向性</strong>，一些带有限制器的格式具有矢量场的专用版本，使用方法为添加后缀<code>V</code>，如：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default limitedLinearV;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<p>以下格式具有矢量场专用版本：<code>limitedLinearV</code>，<code>vanLeerV</code>，<code>GammaV</code>，<code>limitedCubicV</code>和<code>SFCDV</code>。</p>
<hr>
<h1 id="4-面法向梯度格式-snGradSchemes"><a href="#4-面法向梯度格式-snGradSchemes" class="headerlink" title="4. 面法向梯度格式 snGradSchemes"></a>4. 面法向梯度格式 snGradSchemes</h1><p>面法向梯度指的是变量场梯度在面处的法向分量，一般需要在单独计算面法向梯度或者指定拉普拉斯项离散格式时指定面法向梯度格式。面法向梯度格式在子字典<code>snGradSchemes</code>下设置，支持的标准格式有：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">snGradSchemes</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>corrected</code></td>
<td style="text-align:center">显式非正交修正格式</td>
</tr>
<tr>
<td style="text-align:center"><code>uncorrected</code></td>
<td style="text-align:center">无非正交修正格式</td>
</tr>
<tr>
<td style="text-align:center"><code>limited</code></td>
<td style="text-align:center">非完全正交修正格式</td>
</tr>
<tr>
<td style="text-align:center"><code>bounded</code></td>
<td style="text-align:center">对正值标量的有界修正格式</td>
</tr>
<tr>
<td style="text-align:center"><code>fourth</code></td>
<td style="text-align:center">四阶格式（不详）</td>
</tr>
</tbody>
</table>
</div>
<p>特别地，非完全正交修正格式<code>limited</code>需要指定系数，其值介于<code>0</code>和<code>1</code>之间：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center"></th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>0</code></td>
<td style="text-align:center">无非正交修正</td>
</tr>
<tr>
<td style="text-align:center"><code>0.333</code></td>
<td style="text-align:center">限制非正交修正部分不超过正交部分的一半</td>
</tr>
<tr>
<td style="text-align:center"><code>0.5</code></td>
<td style="text-align:center">限制非正交修正部分不超过正交部分</td>
</tr>
<tr>
<td style="text-align:center"><code>1</code></td>
<td style="text-align:center">不限制非正交修正部分，等同于<code>corrected</code>格式</td>
</tr>
</tbody>
</table>
</div>
<p><code>limited</code>格式使用如下：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">default limited 0.5;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<p>有关非正交修正的具体内容，请阅读<a target="_blank" rel="noopener" href="http://link.springer.com/book/10.1007/978-3-319-16874-6">文献</a>第<code>8.6</code>节。</p>
<hr>
<h1 id="5-时间一阶导项-格式-ddtSchemes"><a href="#5-时间一阶导项-格式-ddtSchemes" class="headerlink" title="5. 时间一阶导项 格式 ddtSchemes"></a>5. 时间一阶导项 格式 ddtSchemes</h1><p>时间一阶导项格式在子字典<code>ddtSchemes</code>下设置，支持的标准格式有：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">ddtSchemes</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>Euler</code></td>
<td style="text-align:center">一阶精度，有界，隐式</td>
</tr>
<tr>
<td style="text-align:center"><code>localEuler</code></td>
<td style="text-align:center">局部时间步，一阶精度，有界，隐式</td>
</tr>
<tr>
<td style="text-align:center"><code>CrankNicolson</code></td>
<td style="text-align:center">二阶精度，有界，隐式</td>
</tr>
<tr>
<td style="text-align:center"><code>backward</code></td>
<td style="text-align:center">二阶精度，隐式</td>
</tr>
<tr>
<td style="text-align:center"><code>steadyState</code></td>
<td style="text-align:center">定常，忽略时间导数项</td>
</tr>
</tbody>
</table>
</div>
<p>其中，<code>CrankNicolson</code>格式中的系数介于<code>0</code>和<code>1</code>之间，时为纯Crank-Nicolson格式，时为纯Euler格式。</p>
<hr>
<h1 id="6-时间二阶导项-格式-d2dt2Schemes"><a href="#6-时间二阶导项-格式-d2dt2Schemes" class="headerlink" title="6. 时间二阶导项 格式 d2dt2Schemes"></a>6. 时间二阶导项 格式 d2dt2Schemes</h1><p>时间二阶导项格式在子字典<code>d2dt2Schemes</code>下设置，只支持<code>Euler</code>格式。</p>
<hr>
<h1 id="7-梯度项-格式-gradSchemes"><a href="#7-梯度项-格式-gradSchemes" class="headerlink" title="7. 梯度项 格式 gradSchemes"></a>7. 梯度项 格式 gradSchemes</h1><p>梯度 格式在子字典<code>gradSchemes</code>下设置，支持的标准格式有：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">gradSchemes</th>
<th style="text-align:center">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>Gauss &lt;interpolationScheme&gt;</code></td>
<td style="text-align:center">高斯积分，<code>&lt;interpolationScheme&gt;</code>设置插值格式，二阶精度</td>
</tr>
<tr>
<td style="text-align:center"><code>leastSquares</code></td>
<td style="text-align:center">最小二乘法，二阶精度</td>
</tr>
<tr>
<td style="text-align:center"><code>fourth</code></td>
<td style="text-align:center">最小二乘法，四阶精度</td>
</tr>
<tr>
<td style="text-align:center"><code>cellLimited &lt;gradScheme&gt;</code></td>
<td style="text-align:center">上述格式的体单元有界版本</td>
</tr>
<tr>
<td style="text-align:center"><code>faceLimited &lt;gradScheme&gt;</code></td>
<td style="text-align:center">上述格式的面单元有界版本</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h1 id="8-散度项-格式-divSchemes"><a href="#8-散度项-格式-divSchemes" class="headerlink" title="8. 散度项 格式 divSchemes"></a>8. 散度项 格式 divSchemes</h1><p>此项一般只出现在涉及流体流动的数值模拟中，例如（标量形式）或（矢量形式）。以动量方程中的对流项为例，基于有限体积积分有：</p>
<p>其中，表示面处的质量通量，即。也因此其在<code>OpenFOAM</code>求解器中出现方式为<code>div(phi, U)</code>。</p>
<p>散度项 格式在子字典<code>divSchemes</code>下设置，只支持<code>Gauss &lt;interpolationScheme&gt;</code>格式。为线化此非线性项，在对对流项进行离散的过程中，是作为已知量参与计算的，一般使用上一时间步的速度场计算得到，即</p>
<p>其中，的数值通过Rhie-Chow动量插值计算得到，具体参考<a target="_blank" rel="noopener" href="http://link.springer.com/book/10.1007/978-3-319-16874-6">文献</a>第<code>15.4</code>节。因此，这里的插值格式<code>&lt;interpolationScheme&gt;</code>只针对上式中的，其数学特性如下：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center"><code>&lt;interpolationScheme&gt;</code></th>
<th style="text-align:center">数学特性</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>linear</code></td>
<td style="text-align:center">二阶，无界</td>
</tr>
<tr>
<td style="text-align:center"><code>skewLinear</code></td>
<td style="text-align:center">二阶，带skewness修正，无界</td>
</tr>
<tr>
<td style="text-align:center"><code>cubicCorrected</code></td>
<td style="text-align:center">四阶，无界</td>
</tr>
<tr>
<td style="text-align:center"><code>upwind</code></td>
<td style="text-align:center">一阶，有界</td>
</tr>
<tr>
<td style="text-align:center"><code>linearUpwind</code></td>
<td style="text-align:center">一/二阶，有界</td>
</tr>
<tr>
<td style="text-align:center"><code>QUICK</code></td>
<td style="text-align:center">一/二阶，有界</td>
</tr>
<tr>
<td style="text-align:center">TVD schemes</td>
<td style="text-align:center">一/二阶，有界</td>
</tr>
<tr>
<td style="text-align:center"><code>SFCD</code></td>
<td style="text-align:center">二阶，有界</td>
</tr>
<tr>
<td style="text-align:center">NVD schemes</td>
<td style="text-align:center">一/二阶，有界</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h1 id="9-拉普拉斯项-格式-laplacianSchemes"><a href="#9-拉普拉斯项-格式-laplacianSchemes" class="headerlink" title="9. 拉普拉斯项 格式 laplacianSchemes"></a>9. 拉普拉斯项 格式 laplacianSchemes</h1><p>在流体流动的动量方程中，拉普拉斯项一般为（在<code>OpenFOAM</code>求解器中出现方式为<code>laplacian(nu, U)</code>），基于有限体积积分有：</p>
<p>因此，需要指定的插值格式，同时也要指定面法向梯度的离散格式。拉普拉斯项 格式子字典<code>laplacianSchemes</code>下设置，只支持<code>Gauss &lt;interpolationScheme&gt; &lt;snGradScheme&gt;</code>格式，其中，<code>&lt;interpolationScheme&gt;</code>用于指定的插值格式，<code>&lt;snGradScheme&gt;</code>用于指定面法向梯度的离散格式：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center"><code>&lt;snGradScheme&gt;</code></th>
<th style="text-align:center">数学特性</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>corrected</code></td>
<td style="text-align:center">无界，二阶，守恒</td>
</tr>
<tr>
<td style="text-align:center"><code>uncorrected</code></td>
<td style="text-align:center">有界，一阶，非守恒</td>
</tr>
<tr>
<td style="text-align:center"><code>limited</code></td>
<td style="text-align:center"><code>corrected</code>和<code>uncorrected</code>的混合格式</td>
</tr>
<tr>
<td style="text-align:center"><code>bounded</code></td>
<td style="text-align:center">有界，一阶</td>
</tr>
<tr>
<td style="text-align:center"><code>fourth</code></td>
<td style="text-align:center">无界，四阶，守恒</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h1 id="10-需要计算通量的场-fluxRequired"><a href="#10-需要计算通量的场-fluxRequired" class="headerlink" title="10. 需要计算通量的场 fluxRequired"></a>10. 需要计算通量的场 fluxRequired</h1><p><code>fluxRequired</code>子字典列举了数值模拟过程中需要计算通量的场。例如流体流动模拟中，在求解压力<code>p</code>的方程后需要计算通量，这可以通过在<code>fluxRequired</code>子字典中简单地指定：</p>
<div class="code-wrapper"><pre class="line-numbers language-none"><code class="language-none">fluxRequired &#123;     p; &#125;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></div>
<hr>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/OpenFOAM/">OpenFOAM</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/ffmpeg_denoise/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">ffmpeg Denoise</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/OpenFOAM/fvSolution/">
                        <span class="hidden-mobile">fvSolution</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"w8VaEP3iTgYj1EnQ7TsHSp6k-gzGzoHsz","appKey":"bB6pIAfcqCjPz7ujeqh5nVut","path":"window.location.pathname","placeholder":"说点什么","avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          Fluid.plugins.initFancyBox('#valine .vcontent img:not(.vemoji)');
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <font size="3" face="" color="#2f4154"> <p class="copyright text-muted"> Copyright © Veen 2021 <br> Find me on <a href="https://github.com/Veenxz" target="_blank">GitHub</a> | <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" target="_blank"> <img src="https://d33wubrfki0l68.cloudfront.net/3031be41e8753c70508aa88e84ed8f4f653f157e/d2d9a/images/cc-by-nc-sa.svg" srcset="/img/loading.gif" lazyload alt="Creative Commons"> </a> </p> </font> <div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/js/duration.js"></script> </div> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  
    
  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>





  

  
    <!-- MathJax -->
    <script>
      MathJax = {
        tex: {
          inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        loader: {
          load: ['ui/lazy']
        },
        options: {
          renderActions: {
            findScript: [10, doc => {
              document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
                const display = !!node.type.match(/; *mode=display/);
                const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                const text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = { node: text, delim: '', n: 0 };
                math.end = { node: text, delim: '', n: 0 };
                doc.math.push(math);
              });
            }, '', false],
            insertedScript: [200, () => {
              document.querySelectorAll('mjx-container').forEach(node => {
                let target = node.parentNode;
                if (target.nodeName.toLowerCase() === 'li') {
                  target.parentNode.classList.add('has-jax');
                }
              });
            }, '', false]
          }
        }
      };
    </script>

    <script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" ></script>

  











<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
